
class Test1{
    Object locker = new Object();
    public void fun1(){
        synchronized (locker){
            fun2();
        }
    }
    public void fun2(){
        fun3();
    }
    public void fun3(){
        fun4();
    }
    public void fun4(){
        synchronized (locker){
            System.out.println("4444");
        }
    }
}
public class Demo2 {
    public static void main(String[] args) throws InterruptedException {
        Object locker = new Object();
        Thread t1 = new Thread(() -> {
            synchronized (locker){
                synchronized (locker){
                    System.out.println("t1执行");
                }
            }
        });
        t1.start();
        t1.join();
    }
}
